package com.iocaop.uaa.domain.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

@Entity
@Data
@AllArgsConstructor
@NoArgsConstructor
@Table(name="lzc_roles")
public class Role implements GrantedAuthority, Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    @Column(name="role_name",unique = true,nullable = false,length = 50)
    private String authority;

//    可以注释掉，因为lombok已经实现了 该方法 不重写也不会报错
//    /**
//     * 得到一个角色名
//     * @return
//     */
//    @Override public String getAuthority() {
//        return null;
//    }
}
